package zhaoxiaohan.service;

import spring.BeanPostProcessor;
import spring.annotation.Component;

/**
 * 自定义后置处理bean
 * @author zxh
 */
@Component
public class MyBeanPostProcessor implements BeanPostProcessor {

    @Override
    public Object postProcessBeforeInitialization(Object bean, String beanName) {
        System.out.println("BeanPostProcessor之前 " + beanName);
        return BeanPostProcessor.super.postProcessBeforeInitialization(bean, beanName);
    }

    @Override
    public Object postProcessAfterInitialization(Object bean, String beanName) {
        System.out.println("BeanPostProcessor之后 " + beanName);
        return BeanPostProcessor.super.postProcessAfterInitialization(bean, beanName);
    }

}
